package com.atguigu.gmall.feign.ware;

import com.atguigu.gmall.feign.ware.fallback.WareFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author:ahang
 * @create:2022-10-25 23:20
 * @Description:
 */
@FeignClient(value = "ware-manage",url = "http://localhost:9001",
            fallback = WareFeignClientFallBack.class)
public interface WareFeignClient {

    /**
     * 查询某一号商品是否有库存
     * @param skuId
     * @param num
     * @return
     */
    @GetMapping("/hasStock")
    String hasStock(@RequestParam("skuId") Long skuId,
                    @RequestParam("num") Integer num);
}
